package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.MechanicalLockMapper;
import com.zone.service.domain.MechanicalLock;
import com.zone.service.service.IMechanicalLockService;

/**
 * 钥匙组管理Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-23
 */
@Service
public class MechanicalLockServiceImpl implements IMechanicalLockService 
{
    @Autowired
    private MechanicalLockMapper mechanicalLockMapper;

    /**
     * 查询钥匙组管理
     * 
     * @param id 钥匙组管理主键
     * @return 钥匙组管理
     */
    @Override
    public MechanicalLock selectMechanicalLockById(Long id)
    {
        return mechanicalLockMapper.selectMechanicalLockById(id);
    }

    /**
     * 查询钥匙组管理列表
     * 
     * @param mechanicalLock 钥匙组管理
     * @return 钥匙组管理
     */
    @Override
    public List<MechanicalLock> selectMechanicalLockList(MechanicalLock mechanicalLock)
    {
        return mechanicalLockMapper.selectMechanicalLockList(mechanicalLock);
    }

    /**
     * 新增钥匙组管理
     * 
     * @param mechanicalLock 钥匙组管理
     * @return 结果
     */
    @Override
    public int insertMechanicalLock(MechanicalLock mechanicalLock)
    {
        mechanicalLock.setCreateTime(DateUtils.getNowDate());
        return mechanicalLockMapper.insertMechanicalLock(mechanicalLock);
    }

    /**
     * 修改钥匙组管理
     * 
     * @param mechanicalLock 钥匙组管理
     * @return 结果
     */
    @Override
    public int updateMechanicalLock(MechanicalLock mechanicalLock)
    {
        mechanicalLock.setUpdateTime(DateUtils.getNowDate());
        return mechanicalLockMapper.updateMechanicalLock(mechanicalLock);
    }

    /**
     * 批量删除钥匙组管理
     * 
     * @param ids 需要删除的钥匙组管理主键
     * @return 结果
     */
    @Override
    public int deleteMechanicalLockByIds(Long[] ids)
    {
        return mechanicalLockMapper.deleteMechanicalLockByIds(ids);
    }

    /**
     * 删除钥匙组管理信息
     * 
     * @param id 钥匙组管理主键
     * @return 结果
     */
    @Override
    public int deleteMechanicalLockById(Long id)
    {
        return mechanicalLockMapper.deleteMechanicalLockById(id);
    }

    /**
     * 批量插入钥匙组数据
     *
     * @param mechanicalLockList
     * @return 结果
     */
    @Override
    public int batchInsertMechanicalLock(List<MechanicalLock> mechanicalLockList) {
        return mechanicalLockMapper.batchInsertMechanicalLock(mechanicalLockList);
    }
}
